package com.seeyon.apps.kksso.oasso;

import com.seeyon.apps.kksso.common.UserCoderUtil;
import com.seeyon.ctp.common.log.CtpLogFactory;
import com.seeyon.ctp.portal.sso.SSOLoginHandshakeAbstract;
import com.seeyon.ctp.util.Strings;
import org.apache.commons.logging.Log;

public class ssoLogin extends SSOLoginHandshakeAbstract {
    private final Log log = CtpLogFactory.getLog(this.getClass());
    @Override
    public String handshake(String ticket) {
        if (Strings.isNotBlank(ticket)) {
            try {
                String username = UserCoderUtil.decrypt(ticket);
                log.info("登录成功username: " + username);
                return username;
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    @Override
    public void logoutNotify(String s) {

    }
}
